package com.it.demo.controller;

import com.it.demo.annotation.RepeatSubmit;
import com.it.demo.entity.Device;
import com.it.demo.service.DeviceService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/v1/device")
public class DeviceController {

    @Resource
    private DeviceService deviceService;

    @GetMapping("/list")
    @RepeatSubmit
    public List<Device> list(){
        List<Device> list = deviceService.list();
        System.out.println(list);
        return deviceService.list();
    }
}
